package cn.edu.scau.cmi.linhongyu.abstractFactory;

import java.net.URL;
import java.util.ResourceBundle;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.TextArea;
import javafx.scene.control.TextField;


public class AbstractFactoryController {

    @FXML
    private ResourceBundle resources;

    @FXML
    private URL location;

    @FXML
    private Button create;

    @FXML
    private TextField input1;
    
    @FXML
    private TextField input2;

    @FXML
    private TextArea msg;

    @FXML
    private Label title;


    @FXML
    void initialize() {

    }
    @FXML
    void Even() {
    	MeatFactory meatFactory = null;
    	String text=input1.getText();
    	
    	int i = Integer.parseInt(text);
    	System.out.println(text);
    	Brand brand = null;
		switch (i) {
		case 1:
			brand = new Wens();break;
		case 2:
			brand = new Tianbang();break;
		case 3:
			brand = new Aonong();break;
		}
		msg.appendText(brand.getBrand());
    	Meat meat = null;
    	text=input2.getText();
    	i = Integer.parseInt(text);
    	meat = brand.getFactory(i);
    	System.out.println(meat.getName());
    	msg.appendText(meat.getName());
    }
}
